
#include "nx_api.h"

#ifdef __PRODUCT_NETXDUO__

#include "netx_mdns_test.h"

/* Frame (77 bytes) */
static const unsigned char pkt1[77] = {
0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x18, 0x03, /* ..^..... */
0x73, 0x29, 0x5f, 0x66, 0x08, 0x00, 0x45, 0x00, /* s)_f..E. */
0x00, 0x3f, 0x5c, 0xe5, 0x00, 0x00, 0xff, 0x11, /* .?\..... */
0xbc, 0xba, 0xc0, 0xa8, 0x00, 0x6a, 0xe0, 0x00, /* .....j.. */
0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x2b, /* .......+ */
0x9a, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* .J...... */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x41, /* .......A */
0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */
0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */
0x00, 0x00, 0x01, 0x00, 0x01                    /* ..... */
};

/* Frame (186 bytes) */
static const unsigned char pkt2[186] = {
0x01, 0x00, 0x5e, 0x00, 0x00, 0xfb, 0x00, 0x11, /* ..^..... */
0x22, 0x33, 0x44, 0x57, 0x08, 0x00, 0x45, 0x00, /* "3DW..E. */
0x00, 0xac, 0x00, 0x0a, 0x40, 0x00, 0xff, 0x11, /* ....@... */
0x8f, 0xf9, 0x0a, 0x00, 0x00, 0x42, 0xe0, 0x00, /* .....B.. */
0x00, 0xfb, 0x14, 0xe9, 0x14, 0xe9, 0x00, 0x98, /* ........ */
0x17, 0x2c, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* .,...... */
0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x41, /* .......A */
0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, /* RMMDNSTe */
0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, /* st.local */
0x00, 0x00, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, /* ........ */
0x78, 0x00, 0x04, 0x0a, 0x00, 0x00, 0x42, 0x0b, /* x.....B. */
0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, 0x53, 0x54, /* ARMMDNST */
0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, 0x63, 0x61, /* est.loca */
0x6c, 0x00, 0x00, 0x1c, 0x80, 0x01, 0x00, 0x00, /* l....... */
0x00, 0x78, 0x00, 0x10, 0xfe, 0x80, 0x00, 0x00, /* .x...... */
0x00, 0x00, 0x00, 0x00, 0x02, 0x11, 0x22, 0xff, /* ......". */
0xfe, 0x33, 0x44, 0x57, 0x0b, 0x41, 0x52, 0x4d, /* .3DW.ARM */
0x4d, 0x44, 0x4e, 0x53, 0x54, 0x65, 0x73, 0x74, /* MDNSTest */
0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x00, 0x00, /* .local.. */
0x2f, 0x80, 0x01, 0x00, 0x00, 0x00, 0x78, 0x00, /* /.....x. */
0x19, 0x0b, 0x41, 0x52, 0x4d, 0x4d, 0x44, 0x4e, /* ..ARMMDN */
0x53, 0x54, 0x65, 0x73, 0x74, 0x05, 0x6c, 0x6f, /* STest.lo */
0x63, 0x61, 0x6c, 0x00, 0x00, 0x04, 0x40, 0x00, /* cal...@. */
0x00, 0x08                                      /* .. */
};

MDNS_TEST_SEQ mdns_response_to_address_query[] = {
    {TITLE, "Response to address query", 25, 0},

    /* Add link local address. */
    {MDNS_LLA_ADD, NX_NULL, 0x00000011, 0x22334457},
    {WAIT, NX_NULL, 0, 5},

    /* Recreate mDNS. */
    {MDNS_RECREATE, "ARMMDNSTest", 0, 0},
    {WAIT, NX_NULL, 0, 5},
    {DUMP, NX_NULL, 0, 0},

    /* Inject query. */
    {INJECT, (char*)&pkt1[0], sizeof(pkt1), 0},

    /* Check response. */
    {MDNS_CHECK_DATA_V4, (char*)&pkt2[0], sizeof(pkt2), 1},
};

int mdns_response_to_address_query_size = sizeof(mdns_response_to_address_query) / sizeof(MDNS_TEST_SEQ); 

#endif /* __PRODUCT_NETXDUO__  */

